/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package project.entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import project.entity.Papel.Perfil;

/**
 *
 * @author Wolf
 */
@NamedQueries({
    @NamedQuery(name="searchRevUsername",query="SELECT r FROM Revisor r WHERE UPPER(r.username) LIKE UPPER(:username) AND r.eliminado = false"),
    @NamedQuery(name="searchRevPNome",query="SELECT r FROM Revisor r WHERE UPPER(r.pNome) LIKE UPPER(:pNome) AND r.eliminado = false"),
    @NamedQuery(name="searchRevUNome",query="SELECT r FROM Revisor r WHERE UPPER(r.uNome) LIKE UPPER(:uNome) AND r.eliminado = false"),
    @NamedQuery(name="searchRevEmail",query="SELECT r FROM Revisor r WHERE UPPER(r.email) LIKE UPPER(:email) AND r.eliminado = false"),
    @NamedQuery(name="searchRevEmpresa",query="SELECT r FROM Revisor r WHERE UPPER(r.empresa) LIKE UPPER(:empresa) AND r.eliminado = false")
})
@Entity
public class Revisor extends Utilizador implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @OneToMany(mappedBy = "revisor")
    private Collection<Revisao> revisoes;
    
    
    public Revisor() {
    }

    public Revisor(Collection<Revisao> revisoes, String password, Long numeroBI, String pNome, String uNome, String email, String empresa, Date dataNascimento, boolean eliminado, Date dataRegisto, String username) {
        super(password, numeroBI, pNome, uNome, email, empresa, dataNascimento, eliminado, dataRegisto, Perfil.Revisor, username);
        this.revisoes = revisoes;
    }

    /**
     * @return the revisoes
     */
    public Collection<Revisao> getRevisoes() {
        return revisoes;
    }

    /**
     * @param revisoes the revisoes to set
     */
    public void setRevisoes(Collection<Revisao> revisoes) {
        this.revisoes = revisoes;
    }
    
}
